"""
@Project:ruiji
@File:projectcom.py
@Author:马可
@Date:下午 06:35
"""
import os
import uuid

basedir = os.path.abspath(os.path.dirname(__file__))

def fileupload(file):
    url = basedir +'/static/upload/'
    filename = uuid.uuid1().hex
    if not os.path.exists(url):
        os.makedirs(url)
    name = filename + "."+ file.filename.split(".")[-1]
    file.save(url+name)
    return "/static/upload/"+name